import 'package:flutter/material.dart';
import 'package:get/get.dart';

class ThemePage extends GetView {

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(title: Text('ThemePage')),

      body: SafeArea(
        child: ListView(
          children: [
            Container(
              height: 100,
              child: Align(
                child: Text(
                  '是否是暗色主题：'+Get.isDarkMode.toString(),
                  style: Theme.of(context).textTheme.headline5
                ),
              ),
            ),
            ListTile(
              leading: Icon(Icons.wb_sunny_outlined),
              title: Text('高亮主题'),
              onTap: () {
                Get.changeTheme(ThemeData.light());
              },
            ),
            ListTile(
              leading: Icon(Icons.wb_sunny),
              title: Text('暗色主题'),
              onTap: () {
                Get.changeTheme(ThemeData.dark());
              },
            )
          ],
        )
      )
    );
  }
}